package java_thinking.unit_17._17_2_6;

import java.util.AbstractList;

/**
 * @Desc:   5 具有任意尺寸的list，用Integer数据进行了预初始化
 * @author: cww
 * @DateTime: 2019-04-14 21:23
 */

public class CountingIntegerList extends AbstractList<Integer> {

    private int size;

    public CountingIntegerList(int size) {
        this.size = size < 0? 0 : size;
    }
    @Override
    public Integer get(int index) {
        return Integer.valueOf(index);
    }

    @Override
    public int size() {
        return size;
    }

    public static void main(String[] args) {
        System.out.println(new CountingIntegerList(0));
    }
}
